#include "tipdialog.h"
#include "ui_tipdialog.h"

TipDialog::TipDialog(QWidget *parent)
    : QDialog(parent)
    , ui(new Ui::TipDialog)
{
    ui->setupUi(this);
}

TipDialog *TipDialog::GetInstance(QWidget *parent)
{
    static TipDialog* m_instance = nullptr;
    if(!m_instance){
        m_instance = new TipDialog(parent);
    }
    return m_instance;
}

TipDialog::~TipDialog()
{
    delete ui;
}

void TipDialog::SetText(const QString &title, const QString &text)
{
    this->setWindowTitle(title);
    ui->text->setText(text);
}

void TipDialog::on_pushButton_clicked()
{
    this->close();// 关掉自己即可
}

